﻿//
// Copyright (c) 2024 BPer
//

#ifndef BPERAPP_BPERDECODERAPP_H_
#define BPERAPP_BPERDECODERAPP_H_
#include <bperdecoder/BPerAudioDecoderHandle.h>
#include <bperdecoder/BPerVideoDecoderHandle.h>
#include <vector>

using namespace std;
class BPerPlayerDecoder {
public:
	BPerPlayerDecoder(BPerContext* pcontext);
	virtual ~BPerPlayerDecoder();
	void initAudioDecoder();
	void initVideoDecoder();
	void setInVideoBuffer(BPerVideoDecoderBuffer *pvel);
	void setInAudioBuffer(BPerAudioEncoderBuffer *pael);
	BPerVideoBuffer* getOutVideoBuffer();
	BPerAudioPlayBuffer*  getOutAudioBuffer();
	void startAudioDecoder();
	void startVideoDecoder();

	void setRoomState(int32_t pst);
	void stopAll();
	BPerVideoDecoderHandle *m_videoDec;

private:
	BPerContext *m_context;

	BPerVideoBuffer* m_out_videoBuffer;
	BPerAudioPlayBuffer* m_out_audioBuffer;
	BPerAudioDecoderHandle *m_audioDec;

};


#endif /* BPERAPP_BPERDECODERAPP_H_ */
